<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title></title>
	<style>
		div {
			width: 400px;
			height: 100px;
			border: 1px solid red;
			margin: 10px;
		}
	</style>
	<script src="itcast.js"></script>
	<script>
		
	itcast.fn.extend({
		click: function ( fn ) {
			
			this.each(function () {

				this.onclick = fn;
			
			});

			return this;
		}
	});


	</script>
</head>
<body>
	<div></div>
	<div></div>
</body>
<script>
	I( 'div' ).click(function () {
		alert( '点击了' );
	});

</script>
</html>